
puts("enter number n = ")
@n = gets.to_i
i=2
@primmearray = Array.new
@index=0
while(i<@n)
  i1 = 2
  @index1 = 0
  while(i1 <= i/2)
    
    if(i % i1 == 0) 
        @index1+=1
        break
      end
    i1+=1
  end
  if(@index1 == 0)
    @primmearray[@index] = i
    @index += 1
  end
  i+=1
  end
 @primepowerarray = Array.new
 @index2 = 0
 
index3 = 0
while(index3 < @index)  
  ii = @primmearray[index3] 
  j = ii.to_i
   while(j<@n)
     @primepowerarray[@index2] = j
      @index2 += 1
     j *=ii.to_i
 end 
 index3+=1
end
  
@primepowerarray.sort!()
@primepowerarray.reverse!()
  
@primepowerarray.each() do |iii|
 puts(iii)
end
